// import com.alibaba.druid.DbType;
// import com.alibaba.druid.sql.ast.SQLName;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

#include "SQLPurgeTableStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "SQLExprTableSource.h"

SQLPurgeTableStatement::SQLPurgeTableStatement()
{
}

SQLPurgeTableStatement::SQLPurgeTableStatement(DbType_ptr dbType)
  :SQLStatementImpl(dbType)
{
}

// @Override
void SQLPurgeTableStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLPurgeTableStatement)))
  {
    acceptChild(visitor, table);
  }
  visitor->endVisit(SharedObject(SQLPurgeTableStatement));
}

SQLExprTableSource_ptr SQLPurgeTableStatement::getTable()
{
  return table;
}

void SQLPurgeTableStatement::setTable(SQLName_ptr x)
{
  if (x == nullptr)
  {
    this->table = nullptr;
    return;
  }

  setTable(SQLExprTableSource_ptr(new SQLExprTableSource(x)));
}

void SQLPurgeTableStatement::setTable(SQLExprTableSource_ptr x)
{
  if (x != nullptr)
  {
    x->setParent(SharedObject(SQLPurgeTableStatement));
  }
  this->table = x;
}

int SQLPurgeTableStatement::getCount()
{
  return count;
}

void SQLPurgeTableStatement::setCount(int count)
{
  this->count = count;
}

BOOL_ptr SQLPurgeTableStatement::isAll()
{
  return all;
}

void SQLPurgeTableStatement::setAll(BOOL_ptr all)
{
  this->all = all;
}
